--
-- Author: shunguo.chen
-- Date: 2018-03-01 16:31:01
--
-- IMSimpleRankRender 了解简洁面板里面的排行render

local ClassRef = app.mvc.createRenderClass(...)

function ClassRef.create(node)
	local sprite = ClassRef.extend(node)
	sprite:init()
	return sprite
end

function ClassRef:init(data)
	self.super.init(self, data)
	
	self:refresh()
end

-- data = 伤害排行数据
function ClassRef:refresh()
	self:setVisible(self._data ~= nil)
	if self._data then
		self._ui.LoadingBar:setPercent(self._data.percent)
		self._ui.NO:setString(self._data.rank)
		self._ui.name:setString(self._data.name)
		local str = self._data.value..L(self._data.kind)
		self._ui.num:setString(str)
	end
end

return ClassRef